{extend name="layout/layout" /}

{block name="content"}
<blockquote class="layui-elem-quote quoteBox">
    <form class="layui-form h between">
        <div class="layui-inline searchBox">
            <div class="layui-input-inline">
                <input type="text" class="layui-input name" name="name" placeholder="请输入商品名" />
            </div>
            <div class="layui-input-inline">
                <select name="category_id" lay-verify="required">
                    <option value="">全部分类</option>
                    {foreach name="categorys" item="category"}
                        <option value="{$category.id}">{$category.name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="supplier_id" lay-verify="required">
                    <option value="">所有供货商</option>
                    {foreach name="suppliers" item="supplier"}
                        <option value="{$supplier.id}">{$supplier.name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-input-inline">
                <select class="price_type" name="price_type">
                    <option value="">所有计价方式</option>
                    <option value="1">普通</option>
                    <option value="2">称重</option>
                    <option value="3">计数</option>
                </select>
            </div>
            <input type="text" class="layui-input" value="阻止回车键提交" style="display: none;">
            <a class="layui-btn search_btn" data-type="reload">搜索</a>
            <button type="reset" class="layui-btn layui-btn-danger reset_btn"><i class="layui-icon">&#xe669;</i></button>
            <button type="reset" class="layui-btn layui-btn-warm" id="export_csv" data-url="{:url('admin/'.strtolower($model).'/export')}"><i class="layui-icon">&#xe601;</i>导出</button>
        </div>
        <!--<div class="layui-inline">
            <a class="layui-btn layui-btn-danger layui-btn-normal delAll_btn">批量删除</a>
        </div>-->
        <div class="layui-inline">
            <!--<a href="{:url('admin/product/add')}" class="layui-btn layui-btn-normal add_btn">新增</a>-->
            <a href="javascript:;"  class="layui-btn layui-btn-normal add_btn"><i class="layui-icon"></i> 新增</a>
        </div>
    </form>
</blockquote>

<table id="dataTable" lay-filter="dataTable"></table>

<!--操作-->
<script type="text/html" id="handleBar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
</script>

<input type="hidden" class="datalist_url" value="{:url('admin/product/index')}">
<input type="hidden" class="add_url" value="{:url('admin/product/add')}">
<input type="hidden" class="edit_url" value="{:url('admin/product/edit')}">
<input type="hidden" class="delete_url" value="{:url('admin/product/delete')}">
<input type="hidden" class="handle_url" value="{:url('admin/'.strtolower($model).'/handle')}">
{/block}

{block name="pagescript"}
<script>
    var DELETE_URL = "{:url('admin/product/delete')}";
</script>
<script src="__STATIC__/admin/pages/js/product.js" type="text/javascript"></script>
{/block}